package com.ls.pattern.establish.factory.method;

import com.ls.pattern.establish.factory.pizza.LDCheesePizza;
import com.ls.pattern.establish.factory.pizza.LDPepperPizza;
import com.ls.pattern.establish.factory.pizza.Pizza;

public class LDOrderPizza extends OrderPizza {
    @Override
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new LDCheesePizza();
            System.out.println(pizza.order());
        } else if (orderType.equals("pepper")) {
            pizza= new LDPepperPizza();
            System.out.println(pizza.order());
        }
        return pizza;
    }
}
